package util

import (
	"os"
	"path/filepath"
	"strings"
)

func Getfilepath(rootPath string, keyword string) []string {
	var files []string
	var secretFiles []string

	root := rootPath
	err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
		files = append(files, path)
		return nil
	})
	if err != nil {
		panic(err)
	}
	for _, file := range files {
		if strings.Contains(file, keyword) {
			secretFiles = append(secretFiles, file)
		}
	}
	return secretFiles
}
